﻿@{
    ViewBag.Title = "Home Page";
}
<h2>@ViewBag.Message</h2>


<div id="mainDiv" data-bind="foreach:persons">
    <fieldset style="background-color: #eee">
        <legend>Enter person</legend>
        <p>
            First name:<input type="text" data-bind="value: firstName, valueUpdate:'afterkeydown'" /></p>
        <p>
            last name:<input type="text" data-bind="value: lastName, valueUpdate:'afterkeydown'" /></p>
        <p>
            Full name: <span data-bind="text: fullName"></span>
        </p>
    </fieldset>
</div>

<script type="text/javascript">

    var viewModel = new personsListViewModel();

    viewModel.fetchPersons();

    ko.applyBindings(viewModel);

</script>
